<template>
  <van-nav-bar :z-index="zIndex" :title="title" :border="tabBorder" left-arrow fixed @click-left="back">
    <!-- <span class="iconfont niceziyuanldpi song-icon" slot="right" @click="openFullScreen"></span> -->
    <song-icon slot="right" @openFullScreen="openFullScreen"></song-icon>
  </van-nav-bar>
</template>

<script>
import { mapMutations } from 'vuex'
import SongIcon from '@/components/songIcon/songIcon'
export default {
  props: {
    title: String
  },
  components: {
    SongIcon
  },
  data () {
    return {
      tabBorder: false,
      zIndex: 90
    }
  },
  methods: {
    // 返回上级
    back () {
      if (window.history.length <= 1) {
        this.$router.push({path: '/'})
        return false
      } else {
        this.$router.go(-1)
      }
    },
    openFullScreen () {
      this.setFullScreen(true)
    },
    ...mapMutations({
      setFullScreen: 'SET_FULL_SCREEN'
    })
  }
}
</script>

<style>

</style>
